
const webpack=require('webpack');
const htmlwebpackplugin=require('html-webpack-plugin');

module.exports={
	devtool:'eval-source-map',

	entry:__dirname+'/app/main.js',
	output:{
		path:__dirname+'/build',
		filename:'bundle.js'
	},

	devServer:{
		contentBase:'./public',
		inline:true,
		historyApiFallback:true,
		port:'808'
	},


	module:{
		rules:[
		{
			test:/(\.jsx|\.js)$/,
			use:{
				loader:'babel-loader'
			},
			exclude:/node_modules/
		},
		{
			test:/\.css$/,
			use:[
			{
				loader:'style-loader'
			},{
				loader:'css-loader'
			}]
		}
		]
	},

	plugins:[
		 new webpack.BannerPlugin('版权所有，翻版必究'),
		 new htmlwebpackplugin({
		 	template:__dirname+'/app/index.t.html'
		 })
	]


}